<?php
include ('input.php');
include ('db.php');
session_start();
$user=$input->post('user');
$password=$input->post('pass');
$act=$input->get('act');
$sql="SELECT * FROM login";
$is=$mysql->query($sql)->fetch_array();

if($act!==false){
    if($user==$is['username'] and $password==$is['password']){
        $_SESSION['user']=$is['username'];
        header('location:4.php');
    }else{
        echo '登录失败';
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理员登录</title>
    <link rel="stylesheet" href="2.css">
</head>
<body>
<form action="login.php?act=chk" method="post">
    <input type="text" name="user" >
    <input type="password" name="pass">
    <input type="submit" value="登记" />
</form>
</body>
</html>